Querying Using SQL in Data Sorting and Filtering: An Example of the California State Library
531 Words2 Pages
California State Library
SQL Statement
In this work, the SQL select query is used to highlight how querying using SQL is used in data sorting and filtering in any database. From the database there were several entity relationships observed. Each user borrows one book at a time but the user may have one or many borrowing record. Each borrow record must belong to only one user and each book may have one or many reservation and each borrow record must belong to only one book though each book may have one or many borrow record.
Query Screenshots
California State Library Query1
Name Customer ID City Return Date
Juan Carlos 12388 Beverly Hills 11/10/2012
Katie Holmes 28754 Fresno 12/10/2012
Catherine Doreen 34894 Los Angeles 10/12/2012
Marron Jane 93843 Los Angeles 12/10/2012
Adam Levigne 75384 Los Angeles 12/10/2012
Chu Xi Chin 90333 Sacramento 10/10/2012
Johnie Depp 75992 San Diego 11/10/2012
Jeremy Brown 87982 San Francisco 11/10/2012
Abdul Mohamed 90434 San Jose 12/10/2012
Jerry West 84482 San Jose 10/10/2012
California State Library Query
Customer ID City Book Number Return Date
75384 Los Angeles QE531.E32 12/10/2012
87982 San Francisco QA76.76H94M88 11/10/2012
84482 San Jose QE534.2.B64 10/10/2012
93843 Los Angeles 025.42852523BMC 12/10/2012
12388 Beverly Hills PR4558.A11947ROBA1 11/10/2012
34894 Los Angeles D.664.M32202 10/12/2012
90333 Sacramento QA76.76.T49G641997 10/10/2012
90434 San Jose LB2395.C651991 12/10/2012
75992 San Diego D5559.46.H351986 11/10/2012