23F-A2 SO (1)
.docx
keyboard_arrow_up
School
Carleton University *
*We aren’t endorsed by this school
Course
3005
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
3
Uploaded by CountMeerkat3468
COMP 3005
Assignment #2
Due: Oct. 10 @11:59PM
Instruction
1.
Do the assignments independently. Copying is not allowed.
2.
The database for this assignment is the same as in Assignment #1. Do this assignment directly on this
document and rename it with your last + first name and submit to
brightspace
. Scanned handwritten
documents
won’t
be accepted. Make sure your uploaded file can be opened.
3.
You need to download and install
Oracle VM version 3
on your personal computer running intel chips in
order to run TRC and DRC. Note that they only work partially.
Part 1 Concepts (20 marks)
Explain the following concepts based on the definitions given in the lecture notes. Different answers
found
online
will be marked wrong. The explanation should be complete; i.e, it does not contain any concept not
explained here. Each concept is 2 marks.
1.
Atomic Value:
a value that is indivisible
2.
Tuple:
an ordered set of values
3.
Mini World:
part of the real world the database is built for
4.
Database:
a collection of related data stored for users to easily find what they are looking for
5.
Database System:
database and the application program for easy access to the database.
6.
DBA:
is the person to install DBMS, control its use, monitor its efficiency of operations, authorize
access to the database.]
7.
End User:
the person uses the database in day to day basis but don’t know how the database is organized
8.
Data Model:
it specifies how data are organized and operated
9.
Relational Data Model:
data are organized as sets of tuples called relations that can be accessed using a
query language.
10. Database Schema:
it specifies the structure and integrity constraints of the databases.
Part 2 (80 marks)
Given the employees and projects databases the same as in Assignment #1. Use both Tuple Relational Calculus
(TRC) and Domain Relational Calculus (DRC) to express the same queries as in Assignment Submit your query
expressions for each query as well as the query result. Each query is 8 marks, 4 for TRC and 4 for DRC.
(80)
Marking instruction:
1. if a student used SQL instead, just give 0 for this part. Otherwise, deduct the marks accordingly as in A1.
2. Screenshots are not required.
1)
Get the age of
Last
.
TRC:
{E.Age | E in Employees and E.name='Last')};
DRC:
{A | (exists E) Employees(E, 'Last', A ,_ )};
or {A | Employees(_, 'Last', A ,_ )};
2)
Get the name of
Last’s
manager
TRC:
{E1.name | E1 in Employees and (exists E in Employees)( E.name='Last' and E.manager=E1.E#)};
DRC:
{N| (exists M)(Employees(_, 'Last',_ ,M) and Employees(M, N,_, _))};
3)
Get the name of the employee who works on GPU project.
TRC:
{E.name | E in Employees and (exists W in Workon, P in Projects)(P.name = 'GPU' and E.E# = W.E#
and W.P# = P.P#)};
DRC:
{N | (exists E, P)(Employees(E,N,_,_) and Workon(E,P,_) and (Projects(P, 'GPU',_)};
4)
Get the name of the employee who does not work on any project.
TRC:
{E.name | E in Employees and not (exists W in Workon)(E.E# = W.E#)};
DRC:
{N | (exists E)(Employees(E,N,_,_) and not Workon(E,_,_))};
5)
Get the pair of employee name and project name such that the employee works on the project less than 300
hours.
TRC:
{E.name, P.name | E in Employees and P in Projects and (exists W in Workon)
(E.E# = W.E#
and W.P# = P.P# and W.Hours < 300)};
DRC:
{EN,PN |(exists E, P, H)(Employees(E,EN,_,_) and Workon(E,P,H) and Projects(P, PN,_) and H<300)};
6)
Get the name of the employee who works on every project
TRC:
{E.name | E in Employee and
(forall P in Projects) ((exists W in Workson)(W.E# = E.E# and W.P# = P.P#))};
DRC:
{N | (exists E)(Employees(E,N,_,_) and (forall P)(not Projects(P,_,_) or Workon(E,P,_)))};
7)
Get the name of the employee who works on every project except SSD.
TRC:
{E.name | E in Employees and (forall P in Projects)
(P.Name = 'SSD' and not (exists W in Workon)(E.E# = W.E# and W.P# = P.P#))
or
(P.name <> 'SSD' (exists W in Workon)(E.E# = W.E# and W.P# = P.P#))};
DRC:
{N | (exists E)(Employee(E,N,_,_) and (forall P)
(not (exists M)(Projects(P,M,_) and (M <> 'SSD' or Workson(E,P,_)))
or
(not (exists M)(Projects(P,M,_) and M = 'SSD' or not Workson(E,P,_))))};
8)
Get the name of the employee who works on every project that Clark works on.
TRC:
{E1.name | E1 in Employees and E1.name != 'Clark' and (exists E in Employee)(E.name = 'Clark' and
(forall P in Projects)(exists W in Workon, W1 in Workon)
(E.E# = W.E# and W.E# = P.E# and E1.E# = W1.E# and W1.P# = P.P#)))}:
DRC:
{N | (exists E1,E)(Employee(E1,N,_,_) and N <> ‘Clark’ and (Employee(E,’Clark’,_,_) and (forall P)(not
Workson(E,P,_)) or Workson(E1,P,_)))};
9)
Get the name of the employee who works on the same projects that Clark works on.
TRC:
{E1.name | E1 in Employees and E1.name != 'Clark' and (exists E in Employees)(E.name = 'Clark' and
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
The Developers team also wants you to ensure that emails are converted to lowercase
after an update operation. Currently, new insertions are guaranteed to have lowercase
emails, but there is no such guarantee for legacy emails. Therefore, the team wants to
ensure that emails are being retained in a lowercase irrespective of any changes in the
database. Create a new TRIGGER called email_update for the USERS table that runs
before an UPDATE operation.
Task
Create a TRIGGER to run on the USERS table before any UPDATE operation.
arrow_forward
Create user Peter, Brian and Cindy, create group Family and Friend. Add user Peter and Brian to the Family group, add Cindy to the Friend group. Set up password for all three users.
Log in as Peter, create a file “Peter-file1”, set up permission to allow Brian to read and modify the file, but not Cindy.
Verify your set up to see Peter and Brian can read and modify the file, but not Cindy.
Take screenshot of your configuration.
arrow_forward
Create another application/class named EmployeeDatabase that allows you to store anarray that acts as a database of any number of Employee objects up to 25. While the userdecides to continue, offer three options: to add a record to the database, to delete a recordfrom the database, or to change a record in the database. Then proceed as follows:If the user selects the add option, issue an error message if the database is full.Otherwise, prompt the user for an Id. If the Id already exists in the database, issuean error message. Otherwise, prompt the user for rest of the inputs and add the newrecord to the database.If the user selects the delete option, issue an error message if the database is empty.Otherwise, prompt the user for an Id. If the Id does not exist, issue an error message.Otherwise, delete the record.If the user selects the change option, issue an error message if the database is empty.Otherwise, prompt the user for an Id. If the requested record does not exist, issuean…
arrow_forward
Assignment: Staywell Student Accomodation
I don't understand what I need to do here, its in mySQL. Help would be appreciated!
arrow_forward
Create a MYSQL Database named 'db'Create a MYSQL User named 'dbuser' with a password 'dbpass' Grant Insert, Delete, Update and Select privileges for 'dbuser' on 'db' Create a MYSQL Table on database 'db' and name it as 'students' with the following field and field propertiesField Name Field Type Field Size Additional İnformationStudent No Varchar 6 Primary keyName Varchar 20 Surname Varchar 25 birthdate date
arrow_forward
Submit a write up that describes the steps of creating a database of Certificates using MongoDb. Be sure to include any commands that need to be executed. Also include a description of how querying would be accomplished to select only those certificates with the word "Microsoft"
arrow_forward
Using the appropriate command in the mongo shell, update the document with the ID “20032-2020-ACME” in the collection “inspections” in the database “city” with the information below.
Key
Value
business_name
"New ACME Flowers"
result
"Business Re-opened"
comments
"Flowers after the explosion"
arrow_forward
If you are unclear where the update.txt file is stored on your computer, you may want to print a copy for safekeeping.
arrow_forward
Please use PHPMyAdmin for the database and XAMPP
arrow_forward
Task 5:
The Developers team also wants you to ensure that emails are converted to lowercase after an update operation. Currently, new insertions are guaranteed to have lowercase emails, but there is no such guarantee for legacy emails. Therefore, the team wants to ensure that emails are being retained in a lowercase irrespective of any changes in the database. Create a new TRIGGER called email_update for the USERS table that runs before an UPDATE operation.
arrow_forward
Hello Bartleby I need help with this assignment for my Database Management class. Thank you
SQL - D3 (8 weeks)
No unread replies.No replies.
Capture the output of these queries and upload your output screenshot. Run as a script, copy and paste the output to word, and take its screenshot and paste in paint, save the file, and upload the screenshot file. You can also use the following instructions for embedding images: How to embed an image in Canvas textbox .
1. Display the customer number, customer name, order number, and order date for each order. Sort the results by customer number.
2. Display the customer number, customer name, order number, and order date for all orders. Include all customers in the results. For customers that do not have orders, omit the order number and order date.
3. Create a view named TOYS that consists of the item number, description, units on hand, and unit price of each item in category TOY.
4. List customer number, customer name, rep name,…
arrow_forward
Chapter 17
How to manage database security
Exercises using the My Guitar Shop Database
Use Microsoft SQL Server
Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables.
2.Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user to the OrderEntry role you created in exercise 1.
arrow_forward
If you are unclear of the location of the update.txt file on your computer, you are strongly encouraged to print at least one duplicate of this document.
arrow_forward
The idea of the project is to develop a simple Android app with real-time database. you decide your topic, what your app to be about. Four major functions are expected to be available in the app. These functions are Insert, Read, Update, and Delete data. You are required to use Google Firebase to implement the database.
The application allows the user to create a new object (Insert)
The application allows the user to delete information for an existing object. (Delete)
The application allows the user to browse existing information (Read)
The application allows the user to update existing object information (Update)
Application quality (functionality, design and user interaction, stability …)
use Google Firebase to implement the database
XXXXXXXXXXXXXXX plz other than (task manger) or (to do list) XXXXXXXXXXXXXXXX
arrow_forward
Hello,
I need to find the size of one (1) document within a collection called 'emails' that is within a database called 'enron'. We are using the MongoDB shell. I have provided an image that shows the DB, collection, and the details of one document within emails is at the top of the screenshot. The command used to get that returned all 5,000+ documents but I need just one. Please assist.
arrow_forward
Create a new user account with readWrite permission for your database
using MongoDB
arrow_forward
Create a file named view_roster.php that allows the user to view the current roster including all elements including any pictures that have been uploaded. This page should NOT require authentication to view since the user cannot modify the database from this page. This page should also include nav.php so that the user can go to the other pages if they desire
arrow_forward
in sql
User_123 has successfully logged on to the database in the past, but today he receives an error message stating that he cannot log on. What is the most likely cause of the problem?
Select one:
a.
User_123's CREATE USER privilege has been revoked.
b.
User_123 's CREATE SESSION privilege has been revoked.
c. User_123's user account has been removed from the database.
d.
One or more object privileges have been REVOKEd from User_123 .
arrow_forward
If you do not know the location of the update.txt file on your computer, print a copy.
arrow_forward
• Open MS Access, Select New, type Northwind on the search field, double click to open Northwind database.After the Northwind 2007 is launched as shown below please answer the following questions in a note pad file named “surname student#”.Note: the Northwind sample database in an older version of MS Access is very different from the one in MS Access 2007 or higher )1. What version of Access do you have?2. Choose Object Type on the Navigation Pane. Please list different objects or components available in the Northwind Database window? Describe FIVE of them in simple words in terms of their functions.33. In the TABLE Shippers, how many shippers are there? Please list them.4. In TABLE Orders, which field (i.e. column heading) is identical to the field inTABLE Employees? and TABLE Customers? and TABLE Shippers? Please list all you can find in the format like Orders.field1=Employees.field2, and etc. (Clarification: consider the identity in terms of contents but not the field names, and…
arrow_forward
If you are unsure of the location of the update.txt file on your computer, print one copy.
arrow_forward
Instructions
Create a Login/Registration From that is able to accept a Username/Emailadd and a Password.
Design a Database for the Login and Registration process. Provide at least 2 records that are pre-registered.
Apply animation to your form.
Requirements to be submitted:
a. A snapshot picture of your running webpage.
b. A snapshot picture of your database with at least 2 record stored
c. Attach all your code in a document file to be uploaded with the images.
Software use CSS and HTML
arrow_forward
Q1.True or false? For indexed sequential access the primary key field must contain unique key values for each record.
arrow_forward
Use file permissions along with the chown, chmod, and chgrp commands to create a couple of folders:
Create a directory (mkdir command) inside your home directory and set the permissions using the symbolic mode of chmod. The directory should be named dir1 and both you and the group cs260 should be able get into the directory and read from files. Only you should be able to write to the directory and no one other than you and the cs260 group should be able to access these files in any way.
Create a file in this directory and put your name in it.
Log in as Tess or Jessie and show that you can see the contents of the file.
Save screenshots of both your commands to set up the folder, a listing of your home directory that shows the folder’s permissions, and you logged in as jesse/tess along with the contents of the file printed out on the screen (use vi or cat for this)
Create a directory inside your home directory that both you and the cs260 group have full permissions on. No one else…
arrow_forward
Use file permissions along with the chown, chmod, and chgrp commands to create a couple of folders:
Create a directory (mkdir command) inside your home directory and set the permissions using the symbolic mode of chmod. The directory should be named dir1 and both you and the group cs260 should be able get into the directory and read from files. Only you should be able to write to the directory and no one other than you and the cs260 group should be able to access these files in any way.
Create a file in this directory and put your name in it.
Log in as Tess or Jessie and show that you can see the contents of the file.
Save screenshots of both your commands to set up the folder, a listing of your home directory that shows the folder’s permissions, and you logged in as jesse/tess along with the contents of the file printed out on the screen (use vi or cat for this)
Create a directory inside your home directory that both you and the cs260 group have full permissions on. No one else…
arrow_forward
If you are unsure of the location of the update.txt file on your computer, print a
copy.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Related Questions
- The Developers team also wants you to ensure that emails are converted to lowercase after an update operation. Currently, new insertions are guaranteed to have lowercase emails, but there is no such guarantee for legacy emails. Therefore, the team wants to ensure that emails are being retained in a lowercase irrespective of any changes in the database. Create a new TRIGGER called email_update for the USERS table that runs before an UPDATE operation. Task Create a TRIGGER to run on the USERS table before any UPDATE operation.arrow_forwardCreate user Peter, Brian and Cindy, create group Family and Friend. Add user Peter and Brian to the Family group, add Cindy to the Friend group. Set up password for all three users. Log in as Peter, create a file “Peter-file1”, set up permission to allow Brian to read and modify the file, but not Cindy. Verify your set up to see Peter and Brian can read and modify the file, but not Cindy. Take screenshot of your configuration.arrow_forwardCreate another application/class named EmployeeDatabase that allows you to store anarray that acts as a database of any number of Employee objects up to 25. While the userdecides to continue, offer three options: to add a record to the database, to delete a recordfrom the database, or to change a record in the database. Then proceed as follows:If the user selects the add option, issue an error message if the database is full.Otherwise, prompt the user for an Id. If the Id already exists in the database, issuean error message. Otherwise, prompt the user for rest of the inputs and add the newrecord to the database.If the user selects the delete option, issue an error message if the database is empty.Otherwise, prompt the user for an Id. If the Id does not exist, issue an error message.Otherwise, delete the record.If the user selects the change option, issue an error message if the database is empty.Otherwise, prompt the user for an Id. If the requested record does not exist, issuean…arrow_forward
- Assignment: Staywell Student Accomodation I don't understand what I need to do here, its in mySQL. Help would be appreciated!arrow_forwardCreate a MYSQL Database named 'db'Create a MYSQL User named 'dbuser' with a password 'dbpass' Grant Insert, Delete, Update and Select privileges for 'dbuser' on 'db' Create a MYSQL Table on database 'db' and name it as 'students' with the following field and field propertiesField Name Field Type Field Size Additional İnformationStudent No Varchar 6 Primary keyName Varchar 20 Surname Varchar 25 birthdate datearrow_forwardSubmit a write up that describes the steps of creating a database of Certificates using MongoDb. Be sure to include any commands that need to be executed. Also include a description of how querying would be accomplished to select only those certificates with the word "Microsoft"arrow_forward
- Using the appropriate command in the mongo shell, update the document with the ID “20032-2020-ACME” in the collection “inspections” in the database “city” with the information below. Key Value business_name "New ACME Flowers" result "Business Re-opened" comments "Flowers after the explosion"arrow_forwardIf you are unclear where the update.txt file is stored on your computer, you may want to print a copy for safekeeping.arrow_forwardPlease use PHPMyAdmin for the database and XAMPParrow_forward
- Task 5: The Developers team also wants you to ensure that emails are converted to lowercase after an update operation. Currently, new insertions are guaranteed to have lowercase emails, but there is no such guarantee for legacy emails. Therefore, the team wants to ensure that emails are being retained in a lowercase irrespective of any changes in the database. Create a new TRIGGER called email_update for the USERS table that runs before an UPDATE operation.arrow_forwardHello Bartleby I need help with this assignment for my Database Management class. Thank you SQL - D3 (8 weeks) No unread replies.No replies. Capture the output of these queries and upload your output screenshot. Run as a script, copy and paste the output to word, and take its screenshot and paste in paint, save the file, and upload the screenshot file. You can also use the following instructions for embedding images: How to embed an image in Canvas textbox . 1. Display the customer number, customer name, order number, and order date for each order. Sort the results by customer number. 2. Display the customer number, customer name, order number, and order date for all orders. Include all customers in the results. For customers that do not have orders, omit the order number and order date. 3. Create a view named TOYS that consists of the item number, description, units on hand, and unit price of each item in category TOY. 4. List customer number, customer name, rep name,…arrow_forwardChapter 17 How to manage database security Exercises using the My Guitar Shop Database Use Microsoft SQL Server Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 2.Write a script that (1) creates a login ID named “RobertHalliday” with the password “HelloBob”; (2) sets the default database for the login to the MyGuitarShop database; (3) creates a user named “RobertHalliday” for the login; and (4) assigns the user to the OrderEntry role you created in exercise 1.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you