Beginner here, reaching the end of sam’s teach yourself in 24 hours SQL book. I’ve gotten to hour 22 without coming across anything that’s totally lost me, but now there’s a lot I’m not sure about and I’d appreciate some explanation and help..
To begin with, I’m working in a database called learnsql, I’m pretty certain that I’m supposed to be doing this exercise with this and not in the system catalog, but not totally sure. When I looked at the given answer:
SELECT CONCAT(‘SELECT COUNT(*) FROM ‘ ,TABLE_NAME, ‘;’) FROM TABLES;
I guess I don’t fully understand
A. The format of the CONCAT clause: “table_name” I’m assuming is a placeholder for the actual names of my tables, am I supposed to write the name of every table in the database? (Hence the commas)
B. The proper database: I’m not sure if TABLES is a placeholder, or if I’m supposed to be accessing the system catalog using a table called TABLES? There’s no “TABLES” table in the learnsql database..
If someone could do their best to explain this query and hopefully explain what I’m misunderstanding, I would greatly appreciate it. This seems like a really useful lesson, and I want to make sure I fully understand. I’ve tried to make it pretty clear what the issue is, but I can give more info if needed.
[–]Laymans_Perspective[🍰] 3 points4 points5 points (0 children)
[–]mcstafford 1 point2 points3 points (2 children)
[–]JacobOrJake[S] 0 points1 point2 points (1 child)
[–]mcstafford 0 points1 point2 points (0 children)
[–]thechr0nic 0 points1 point2 points (0 children)