TAILIEUCHUNG - SQL VISUAL QUICKSTART GUIDE- P40

SQL VISUAL QUICKSTART GUIDE- P40:SQL (pronounced es-kyoo-el) is the standard programming language for creating, updating, and retrieving information that is stored in databases. With SQL, you can turn your ordinary questions (“Where do our customers live?”) into statements that your database system can understand (SELECT DISTINCT city, state FROM customers;) | Chapter 11 Creating a New Table from an Existing One To create a new table from an existing table Type CREATE TABLE new_table AS subquery new_table is the name of the table to create. subquery is a SELECT statement that returns rows to insert into new_table. The DBMS uses the result of subquery to determine the structure of new_table and the order names data types and values of its columns. Listing copies the structure and data of the existing table authors to a new table named authors2. Listing uses a WHERE condition that always is false to copy only the structure but not the data of the existing table publishers to a new table named publishers2. Listing creates a global temporary table named titles2 that contains the titles and sales of books published by publisher P01 see Creating a Temporary Table with CREATE TEMPORARY TABLE earlier in this chapter. Listing uses joins to create a new table named author_title_names that contains the names of the authors who aren t from New York State or California and the titles of their books. Listing Copy the structure and data of the existing table authors to a new table named authors2. Listing CREATE TABLE authors2 AS SELECT FROM authors Listing Copy the structure but not the data of the existing table publishers to a new table named publishers2. Listing CREATE TABLE publishers2 AS SELECT FROM publishers WHERE 1 2 Listing Create a global temporary table named titles2 that contains the titles and sales of books published by publisher P01. Listing CREATE GLOBAL TEMPORARY TABLE titles2 AS SELECT title_name sales FROM titles WHERE pub_id P01 Listing Create a new table named author_title_names that contains the names of the authors who aren t from New York state or California and the titles of their books. Listing CREATE TABLE author_title_names AS SELECT FROM authors a INNER JOIN title_authors ta ON INNER JOIN titles t ON .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.