12 Feb Theory questions/problems
Q.1 [25 points] Theory questions/problems
a. [ 5 points] Define (i) tuple (ii) domain (iii) schema of a relation (iv) state of a relation, and (v) relational database system.
b. [ 5 points] What is a referential integrity or foreign key constraint? Give an example.
c. [ 5 points] What are three UPDATE operations in a database relation? Does the integrity constraints necessary in UPDATE operation?
d. [ 5 points] List the data types that are allowed for SQL attributes.
e. [ 5 points] Explain the basic form of the SELECT statement. Show the extended version of SELECT statement for ordering Query Results.
Q.2 [25 points] Practical/lab problems
Specify the following queries in SQL on the COMPANY relational database schema shown in Figure 5.5. Show the result of each query if it is applied to the COMPANY database in Figure 5.6.
a. [ 5 points] Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ProductX project.
b. [5 points] List the names of all employees who have a dependent with the same last name as themselves.
c. [ 5 points] Find the names of all employees who are directly supervised by Mr. Wong.
Part2: Consider that the EMPLOYEE table’s constraint EMPSUPERFK as specified in Figure 6.2 is changed to read as follows: CONSTRAINT EMPSUPERFK
FOREIGN KEY (Super_ssn) REFERENCES EMPLOYEE(Ssn)
ON DELETE CASCADE ON UPDATE CASCADE,
Now, Answer the following questions:
d. [5 points] What happens when the following command is run on the database state shown in Figure 5.6? DELETE EMPLOYEE WHERE Lname = ‘Borg’
b. [5 points] Is it better to CASCADE or SET NULL in case of EMPSUPERFK constraint
ON DELETE?
FIGURE 5.5
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.