I have attached the tables that are included in this question for MYSql. My question states: First and last names of the top 5 authors clients borrowed in 2017. My code so far: I think so far my code just displays the top 5 Author ID in 2017 but I can’t figure out how to display the names. I see
Tag: mysql
I’m trying to update the values of a table SQL have an error in Java
I’m trying to update the values of a table, but it throws an error that I have not been able to determine. If you visualize it it would help me, this is what it throws by console: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that cor…
Are there faster alternatives to the CROSS JOIN model used below?
All I know is CROSS JOIN, but sometimes I look on StackOverflow for query support and find some answer mentioning that this is not the best join. I don’t know if they’re saying that due to an opinion on what would be easier on the developer, or if CROSS JOIN is functionally inferior to its JOIN br…
I am getting a “subquery returning multiple rows” error. I want to return multiple rows however
I want to have a subquery which returns multiple rows in MySQL. I used the IN function as well. However i am getting a “subquery returning multiple rows” error. I have attached an image of the tables used and the desired output Here is my SQL code: Answer You seem to want conditional aggregation:
Granting privileges to a user named “Grant”?
How do I grant permissions to a user who is named “Grant”? It throws an error. Error: ‘Grant’ is not valid at this position. Expecting an identifier. Answer You have to use backticks when using reserved keywords or identifiers with otherwise illegal characters as identifiers Apostrophe…
How to solve Can’t connect to MySQL server on ‘localhost’ (10061) when setting lower_case_table_names=0?
When creating tables in mysql i noticed that all my table names started with lowercase even when I namned them with an upper case. I found that going into : C:ProgramDataMySQLMySQL Server 8.0 Opening the my.ini file and changing the lower_case_table_names=0 Would to the trick according to this video. After do…
What does the MySQL mean by “Column count doesn’t match value count at row 1”
This is the message I’m getting ER_WRONG_VALUE_COUNT_ON_ROW: Column count doesn’t match value count at row 1 This is my whole code. Where is my mistake? Answer Your employee table has 7 columns, but you are giving 8 values for insert, which generates the error message that you are getting. A good …
How can I query my table to group it by 2 fields in mySQL?
I’m stuck. I’m trying to query one of my tables to obtain the maximum ‘canister_change_date’ with grouped pairs ‘canister_type’ and ‘test_cell’. I’ve put together a table with some dummy data (below) If you want the create table schema, let me know and I&#…
SQL (MYSQL, Postgres) Lookup/report table
I’m basically making a lookup table for my three tables but its not doing what I want. Those 3 tables were created by loading 3 different csv files. What I’m trying to do is inserting the ID’s from those tables into the lookup one. This is what I keep getting: What I need is: I kind of get w…
How to extract the information from JSon in MYSQL
I have Sample Data I’m getting Data Like this : I’m trying to get output like this : Can any one Suggest me . Answer In MySQL 8.0, you can use json_table() for this: Or if you want the results as a scalar value: In earlier versions, you would typically use a table of numbers and json_extract():