loading..
Русский    English
11:39

Exercise #6 (tips and solutions)

Joining of tables (here inner join is needed) is possible to execute in two ways:

1. Through WHERE clause (a single opportunity before occurrence of standard SQL-92)

Console
Execute
  1. SELECT DISTINCT Product.maker, Laptop.speed
  2. FROM Product, Laptop
  3. WHERE Product.model = Laptop.model
  4. AND Laptop.hd >= 10

2. By means of explicit operation of JOIN

Console
Execute
  1. SELECT DISTINCT Product.maker,Laptop.speed
  2. FROM Product JOIN
  3. Laptop ON Product.model = Laptop.model
  4. WHERE Laptop.hd >= 10

Though  Cистема управления реляционными базами данных (СУБД), разработанная корпорацией Microsoft. SQL(Structured Query Language) is a database computer language designed for the retrieval and management of data in relational database management systems (RDBMS), database schema creation and modification, and database object access control management.SQL Server query optimizer will produce the identical plans of executing both queries, the second variant which allows to separate conditions of joining the tables from conditions of  filtering the rows is preferable.

To return to discussion of exercise #6

To solve a problem on SQL-EX.RU

Bookmark and Share
Tags
aggregate functions Airport ALL AND AS keyword ASCII AVG Battles Bezhaev Bismarck C.J.Date calculated columns Cartesian product CASE cast CHAR CHARINDEX Chebykin check constraint classes COALESCE common table expressions comparison predicates Computer firm CONVERT correlated subqueries COUNT CROSS APPLY CTE data type conversion data types database schema date/time functions DATEADD DATEDIFF DATENAME DATEPART DATETIME DDL DEFAULT DEFAULT VALUES DELETE DISTINCT DML duplicates EXCEPT exercise (-2) exercise 19 exercise 23 exercise 32 More tags
The book was updated
month ago
©SQL-EX,2008 [Evolution] [Feedback] [About] [Links] [Team]
All right reserved.
Rambler's Top100