SQL VIEW Exercises: Create a view for the salesmen who belongs to the city New York
SQL VIEW: Exercise-1 with Solution
1. From the following table, create a view for those salespersons belong to the city 'New York'.
Sample table: salesman
CREATE VIEW newyorkstaff AS SELECT * FROM salesman WHERE city = 'New York';
sqlpractice=# select * from newyorkstaff; salesman_id | name | city | commission -------------+------------+----------+------------ 5001 | James Hoog | New York | 0.15 (1 row)
Inventory database model:
Contribute your code and comments through Disqus.
Test your Programming skills with w3resource's quiz.
What is the difficulty level of this exercise?
SQL: Tips of the Day
MySQL export schema without data
mysqldump -h yourhostnameorIP -u root -p --no-data dbname > schema.sql
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework