A Guide to SQL
A Guide to SQL
9th Edition
ISBN: 9781111527273
Author: Philip J. Pratt
Publisher: Course Technology Ptr
bartleby

Concept explainers

Question
Book Icon
Chapter 5, Problem 1RQ
Program Plan Intro

SQL:

  • SQL stands for “Structured Query Language”.
  • The current version of SQL is “ANSI SQL – 92”.
  • SQL is not a programming language. It is text-based and it is also called as data sublanguage.
    • In order to get SQL as a complete programming language, it should be included in scripting languages like Java, C#, and so on.
  • It contains constructs which are used to define and process database. They are executed using DBMS-supplied command prompt.
  • Some of the DBMS products provide GUI tools in order to perform tasks are as follows:
    • SQL Server
    • Oracle Database
    • MySQL

Expert Solution & Answer
Check Mark

Explanation of Solution

 Joining tables in SQL:

 Joining is done in order to retrieve information from more than one table. In SQL joining is done by finding rows in the two tables that have identical values in matching columns and it is done using “WHERE” clause. One should construct the following SQL commands in order to join the tables.

  • In the “SELECT” clause, one should all the column names that the user wants to display.
  • In the “FROM” clause, the user should list all the table names that are involved in the query.
  • In the “WHERE” clause, the user must restrict the rows that have similar values in matching columns.

 Syntax:

 SELECT columns FROM table_Name1, table_Name2 WHERE condition;

 Example:

 Consider two tables name “EMPLOYEE” and “SALARY”. The table “EMPLOYEE” contains details of the employee like “emp_id”, “name”, “age” and the table “SALARY” contains columns like “emp_id”, and “salary”. These two tables can be joined by the following statement.

 SELECT emp_id, name, age, salary FROM EMPLOYEE, SALARY WHERE EMPLOYEE.emp_id = SALARY.emp_id;

 The above query joins values from two tables.

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Text book image
Oracle 12c: SQL
Computer Science
ISBN:9781305251038
Author:Joan Casteel
Publisher:Cengage Learning