Question: Write an SQL statement to c reate a table called state_tbl with the following fields/attributes: Name as text Capital as text Population as numeric Square_mile
- Write an SQL statement to create a table called state_tbl with the following fields/attributes:
- Name as text
- Capital as text
- Population as numeric
- Square_mile as numeric
- Use the PSQL command to display
- All relations/tables in your directory
- The information about the table you just created
- Populate the state_tbl table from a text file using the copy statement to copy data from a tab-delimited text file, which has the same file structure as the table created in question #1.
\copy state_tbl from /home/sql/examples/states.txt
- Using your populated state_tbl entity above, write SQL statement to display California State only (your query should return one row).
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
