Beruflich Dokumente
Kultur Dokumente
Universidad de Len
Course 2014-2015
1.5 To run the script, you can click on the Execute ( ! ) button or press F5
1.6 After that in the Object Explorer pane, the pubs database should appear by clicking on
the + button near the Databases folder.
Universidad de Len
Databases
Course 2014-2015
Query Window.
2.1 Now that we have correctly installed the pubs database, we need to connect with it.
Clicking on the New Query button, we open a new pane where we can write and run
our sentences.
2.2 Create a sentence using transient SQL to check that our database pubs exists.
2.3 Select the database pubs to work with it.
2.4 Show all the tables names which belonges to pubs database.
2.5 Show the description of the table titles
2.6 Show the type of all the books stored in the table titles
2.7 Show the title and the price of all the books
2.8 Show the title and the price of the books with a valid price.
2.9 Show the last query in descending order.
2.10 Repeat the last query but just showing the business books, adding the alias Business
books to the title column.
2.11 Show the title, the price in dolars and the price in euros of the books with a valid price.
(The price in the table is in dolars and 1$=0.80)
2.12 Show the description of the table sales
2.13 Show all the data available for sales
2.14 Show all the sales done before 15/02/93 (Remember than depending on the language of
your installation, the DATE format can change. By clicking with the right button in the
SQL\SQLEXPRESS icon in the Object Explorer-> Properties you can see the language
of your Server. In USA, the format is MM/DD/YY whereas in Europe is DD/MM/YY)
2.15 Show all the sales done before 15/02/93 with less than 30 books (qty) and all the sales
done after that date with 50 or more.
2.16 Show the description of the table authors
2.17 Show all the data available for authors
2.18 Show all the authors sorted by their state and their city
2.19 Show the au_id, au_lname and au_fname of all the authors whit a phone number which
starts by 415. Change the name of the columns to make it more understandable.
2.20 Show just the phone and the city of all the authors which lives in Gary, Salt Lake City,
Covelo or Berkeley without using OR
2.21 Show all the first name authors that starts with a consonant.
2.22 Show all the first name authors that starts with a vowel.
2.23 Show the first name and last name of employees which have a job level between 100
and 200 sorted by job level in ascending order.
Universidad de Len
Databases
Course 2014-2015