Syntax for creating table with primary key and foreign key


Question 1) Create the sales order database of 2 tables Sales_order and sales_order_detail with the following fields-

Sales_order                                                   Sales_order_detail
S_order_ no                                                           s_order_no
S_order_date                                                         product_no
Client_no                                                                Qty__oredered
Salesman_no                                                          product_rate
Dely_date
Order_status

Set relationship between two tables.

Queries:

1) Name all the orders that are cancelled in the month of March?

2) Demonstrate all details of sales_order whose S_order_date is ’12-jan-96’ and whose product_no is ‘P00001’?

3) Show all records of sales_order_detail where the salesman_no is between ‘S00001’ and ‘S00005’?

4) Show client_no, S_order_date, salesman_no where the dely_date is ’26- may- 96’?

5) Display all record whose Qty_ord ered is >=10?

Question 2) Create two tables:

1) stud_info with fields as roll, name, address, Date_of_addmission, fees

2) Stud_marks with fields as roll, sub1, sub2, sub3, total

Now answer the following:

1) Write down the syntax for creating the two table with primary key and foreign key as roll for both the table?

2) Print the student’s information who has taken admission in month of February?

3) Print the student’s information those has n as the 3 letter in their name?

4) Print the marks of the student whose roll no is same as the roll no of the student whose admission date is ‘2-jun-06’?

5) Print the marks of sub2 who has got more than 20 marks?

Request for Solution File

Ask an Expert for Answer!!
Database Management System: Syntax for creating table with primary key and foreign key
Reference No:- TGS08053

Expected delivery within 24 Hours