Database / SQLite Interview questions
What is a VIEW in SQLite?
A VIEW is a saved, named query that behaves like a virtual, read-only table — querying
the view runs the underlying query fresh each time, rather than storing its own separate copy of data.
CREATE VIEW adult_person AS SELECT id, name, age FROM person WHERE age >= 18; SELECT * FROM adult_person; -- runs the underlying query each time
Views are useful for encapsulating a commonly-needed, possibly complex query behind a simple name, so
application code (or other queries) can reference adult_person without repeating the full
WHERE condition everywhere it's needed. Since a view has no storage of its own, updating the
underlying tables automatically changes what the view returns the next time it's queried — there's no
separate "refresh" step required.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
