tailieunhanh - SQL VISUAL QUICKSTART GUIDE- P6

SQL VISUAL QUICKSTART GUIDE- P6: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 1 PostgreSQL PostgreSQL PostgreSQL pronounced post-gres-kyoo-el is an open-source DBMS that supports large databases and numbers of transactions. PostgreSQL is known for its rich feature set and its high conformance with standard SQL. It s free and runs on many operating systems and hardware platforms. You can download it at . This book covers PostgreSQL but also includes tips for earlier versions back to . To determine which version of PostgreSQL you re running run the PostgreSQL command-line command psql -V or run the query SELECT VERSION . To run SQL programs use the psql command-line tool. Tip To open a command prompt in Windows choose Start All Programs Accessories Command Prompt. To use the psql command-line tool interactively 1. At a command prompt type psql -h host -U user -W dbname host is the host name user is your PostgreSQL user name and dbname is the name of the database to use. PostgreSQL will prompt you for your password for a passwordless user either omit the -W option or press Enter at the password prompt . 2. Type an SQL statement. The statement can span multiple lines. Terminate it with a semicolon and then press Enter to display the results Figure . Figure results of a SELECT statement in psql interactive mode. 30 DBMS Specifics Command Prompt Figure The same SELECT statement in psql script mode. To use the psql command-line tool in script mode 1. At a command prompt type psql -h host -U user -W -f sql_script dbname host is the host name user is your PostgreSQL user name and dbname is the name of the database to use. PostgreSQL will prompt you for your password for a passwordless user either omit the -W option or press Enter at the password prompt . The -f option specifies the name of the SQL file sql_script which is a text file containing SQL state-ment s and can include an absolute or relative pathname. dbname is the name of the database to use. 2. Press Enter to display the results Figure .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.