Can you please provide me more examples or any sources that I can find a questio
ID: 3734003 • Letter: C
Question
Can you please provide me more examples or any sources that I can find a question which would be related above questions.
Task 1. (10 points). Specify primary key and foreign key constraints for the LDB. Give reasons explaining your decisions. Represent the database as a tabular schema diagram (tables linked with arrows showing foreign key dependencies); underline primary keys. Student Book Writer St id sbn Writer id me ame ame surname addres Authors writer id isbn Loan St id isbn Start date End datc We assume that st id, isbn, and writer id are unique in Student, Book, and Writer respectively and use them there as primary keys. Foreign keys are shown by arrows. One book mav be written bw several anthors. and one author may have several honks hence theExplanation / Answer
Solution:
Example of some of the queries are:
DDL:
CREATE TABLE Student(
StudentNo int NOT NULL,
StudentName;
PRIMARY KEY (StudentName)
);
CREATE TABLE StudentMajor(
StudentNo int NOT NULL,
MajorID int NOT NULL,
PersonID int,
PRIMARY KEY (MajorID),
CONSTRAINT FK_StudentID FOREIGN KEY (StudentID)
REFERENCES Student(StudentID)
);
DML:
SELECT orderNo, lineNo, productNo FROM MSC_ORDER_DETAIL WHERE ship_quantity IS NULL
Display empl_first_name, empl_last_name and job_code for employee number 220.
SELECT empl_first_name, empl_last_name, job_code FROM MSC_ORDER_DETAIL WHERE employeeNo= 220
Display the product number, vendor number and quantity in stock value for product detail where the quantity in stock is in the 200 to 300 range from the MSC_product_detail table sorted in descending order by quantity in stock value.
SELECT product number, vendor number, quantity MSC_product_detail WHERE quantity>=200 AND quantity<=300 ORDER BY quantity DESC
Display the number (tally) of customers who are located in the state of Florida.
SELECT COUNT(customerNo) FROM Customers WHERE location= 'Florida'
We are not allowed to provide links to external sites in the answer section, but if you are not satisfied with the examples which I have provided you, please let me know in the comments, I will certainly try to help you. Thanks :)
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)