Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Student Learning Outcomes: Students will experience example of a Relational Model. Students will apply SQL language on relational database. Student will learn how to create

Student Learning Outcomes: Students will experience example of a Relational Model. Students will apply SQL language on relational database. Student will learn how to create a new table; update / delete data in a database; insert new data; extract data from a database; etc. Instructions: 1. Click http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_all , click the tables name on the right side, and view the related record in each table. 2. Create a table called "Persons" that contains five columns: PersonID, LastName, FirstName, Address, and City. Sample code are: CREATE TABLE Persons ( PersonID int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), PRIMARY KEY (PersonID) )

3. Click Run SQL, and check if there is any change with the listed table names on the right. Record the change. Click the new added table, and record what you see. 4. Insert a new row in the new created Persons" table.

INSERT INTO Persons (PersonID, LastName, FirstName, Address, City) VALUES ('123','Erichsen','Tom','1600 Harden St.', 'Columbia');

5. Click the table and record the outcome. 6. Click table Customers, write down the related information for the customer "Alfreds Futterkiste". 7. Update the customer "Alfreds Futterkiste" with a new contact person and city, using the following SQL statement: UPDATE Customers SET ContactName='Alfred Schmidt', City='Hamburg' WHERE CustomerName='Alfreds Futterkiste';

8. Write down the related information for the customer "Alfreds Futterkiste", and check the difference. 9. Use SQL language to show the "CustomerName" and "City" columns only from the "Customers" table, and describe what you see. SELECT CustomerName,City FROM Customers;

10. Use SQL language to show all the customers records from the country "Mexico", in the "Customers" table, and describe what you see and how many records. SELECT * FROM Customers WHERE Country='Mexico';

11. Check the record number in the "Customers" table. And now delete the customer "Alfreds Futterkiste" from the "Customers" table. DELETE FROM Customers

WHERE CustomerName='Alfreds Futterkiste';

12. Check the record number in the "Customers" table, and describe the change. 13. Add a column named "DateOfBirth" in the "Persons" table using the following SQL statement:

ALTER TABLE Persons ADD DateOfBirth date

14. Check the table Persons and describe the change. 15. Delete table Customers using: DROP TABLE Customers 16. Describe the change of the database. Question set: 1. Is this lab easy to you? Why or why not? 2. Which part is the hardest part to you? 3. What's the most interesting part you learned? Explain it shortly. Report: Use a word file describe what happens for each step, include the related screenshots. And answer the question set. Submit the report file to the linked dropbox.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. Describe cultural differences that influence perception

Answered: 1 week ago