Tag Info

New answers tagged

0

---Method 1 using Ident_Current BEGIN TRAN INSERT INTO places (place_name) VALUES ('XYZ') INSERT INTO trips (trip_name) VALUES ('MyTrip') Insert INTO trips_places_asc (trip_id,place_id) values (Ident_Current('trips'), Ident_Current('places')) COMMIT TRAN ---Method 2 Using Scope_Identity ...


2

A general goal in designing data storage and retrieval systems is that query time should scale with the amount of data being retrieved, not the amount of data that exists in total. Partitioning is a powerful tool for achieving that goal. Consider a table of session data that looks something like: create table clickstream ( clickstream_id bigserial ...


1

This line represents a cartesian product of 3 tables: FROM student a, enrolled i, class d After creating a cartesian product you filter out rows that match the predicate. WHERE a.id= i.student_id AND i.disc_id = d.id If you look closer at this query it is equivalent to: SELECT a.name, d.name. d.grade FROM student a JOIN enrolled i ON ...



Top 50 recent answers are included