#CS403 #CS403Assignment3 #403AssignmentSolution #LearningSchools
CS403 Assignment No. 3 Spring 2020 Solution
Question Statement
The relational data model is given below:
User (user_id, name, number, password, address, cart_id)
Medicine (med_id, name, price, expiry_date, shelve-id, cart_id, Order_id)
Order (order_id, medicines, total_price, time, date, user_id, pharm_id, payment_id)
Prescription (pres_id, image_url, Order_id)
Payment (pyment_id, card_number, amount, status, date, time)
Pharmacist (pharm_id, name, username, password, number, address)
Shelve (shelve_id, number)
CreditCard (card_number, expiry_date)
ShoppingCart (cart_id, cart_items, amount)
Now in third assignment, you are required to perform the following tasks:
1) Convert the above relational data model into a physical data model. For which you have to first create a database. The database name should be as your student id. For example, if your student id is BC123456789, then the database name should be BC123456789. [3 marks]
2) After the database creation, you are required to write the SQL queries in order to create the above nine tables in the database. You are also required to apply different constraints like primary key constraint and foreign key constraints where applicable. [6 marks]
Marks will be deducted if primary and foreign key (where required) constraints are not implemented.
3) After the creation of tables, insert the following data in the given tables: [5 marks]
How to install SQL SERVER step by step : • How to install Microsoft SQL Server 2012
Solution
Query download link : http://www.mediafire.com/file/7txtfpt...