220 likes | 416 Views
FIM: SQL. Stefano Grazioli. Critical Thinking. Lab 11:30-1:00 Easy meter . How do I talk to a DBMS?. SQL. In one hour. Before Querying…. Figure out what data is available Ask about the data model and the data dictionary, but… …they may not have it.
E N D
FIM: SQL Stefano Grazioli
Critical Thinking • Lab 11:30-1:00 • Easy meter
How do I talk to a DBMS? SQL In one hour
Before Querying…. • Figure out what data is available • Ask about the data model andthe data dictionary, but… • …they may not have it. A picture of the contents of the database A text description of the contents of the database (e.g. columns content)
SmallBank Ltd. Database example
ACTUAL TABLE DIAGRAM Loan Officer Table LO id f name l name phone
Data Model: SmallBank,Ltd. One Many
Reading the Relationships 1 6 One 5 2 Many 3 4
Navigating the Relationship (join) foreign key: a PK in another table, used to link the two tables
Different “Dialects” Chen ModifiedChen (IE) IDEF1X 0:n 1:1 works in Employee Dept works in Employee Dept works in Employee Dept Dept Employee
WINIT What Is NewIn Technology?
Homework SQL Practice
SQL • Structured Query Language • The standard language for databases • 70s: - Codd - SEQUEL – Structured English QUEry Language • commercialized it in 1979 • 1986 ISO/ANSI • Sometimes sought as a required skill in interviews
SQL EXAMPLE: A QUERY SELECT First_Name, Last_Name, ssn FROM StudentTbl WHERE gpa > 3.0 ORDER BYLast_Name;
4+2 BASIC SQL COMMANDS • SELECT • INSERT • UPDATE • DELETE • CREATE • DROP
Interacting with a DB (1) SQL Web server Data (Customer, Product, Order) Your browser DBMS You On your local machine(e.g., laptop, lab PC) On a Server
Interacting with a DB (2) SQL Data (Customer, Product, Order) Some BIsoftware DBMS You On your local machine(e.g., laptop, lab PC) On a Server Example: Tableau, Excel
Interacting with a DB (3) SQL SmallBank DB (Loan, Loan Officer, Customer…) Visual Studio SQL ServerDBMS You Your local machine(e.g., laptop, lab PC) Server F-sg6m-s4.comm.virginia.edu DEMO
Suggestions Make sure that you can access the DB asap(this afternoon). Come to office hours or lab if you cannot.
You do the talking • Name, Major • Learning Objectives • Things you like about the class • Things that can be improved • Attitude towards the Tournament