← prev | next →
brijeshJoshiii 2020-06-19 12:06:27
Ajay 2020-06-19 12:06:06
with ON t1.id = t2.id. Isn’t it?
ya
Master Yoda 2020-06-19 12:10:49
brijeshJoshiii 2020-06-19 12:05:06
in where clause instead of selecting max(age) from t1 select max(age) from join of t1 and t2
Simply adding left instead of inner would work
brijeshJoshiii 2020-06-19 12:12:14
brijeshJoshiii 2020-06-19 12:05:06
in where clause instead of selecting max(age) from t1 select max(age) from join of t1 and t2
you can also use order by desc and set limit 1….but it will only work if the table consists of only one max age
brijeshJoshiii 2020-06-19 12:15:56
Master Yoda 2020-06-19 12:10:49
Simply adding left instead of inner would work
no it wouldn’t cuz for the table t1 we have id=18 for which there is no corresponding row in t2 so rest cells in the row will be set to null
brijeshJoshiii 2020-06-19 12:17:00
brijeshJoshiii 2020-06-19 12:15:56
no it wouldn’t cuz for the table t1 we have id=18 for which there is no corresponding row in t2 so rest cells in the row will be set to null
id =4 and age =18 *****
Master Yoda 2020-06-19 12:21:07
Of course if it is deleted it will give null
Master Yoda 2020-06-19 12:21:25
I assumed no such scenario but the original query he gave
Master Yoda 2020-06-19 12:22:41
Master Yoda 2020-06-19 12:21:07
Of course if it is deleted it will give null
Because no such corresponding value in other table exists
Master Yoda 2020-06-19 12:31:56
Select t1.name, t2. Marks from t1 left join t2 on t1. Id=t2. Id where age=(select age from t1 order by age desc limit 1,1) —- this will give person having marks with second highest age.
Master Yoda 2020-06-19 12:36:05
Master Yoda 2020-06-19 12:31:56
Select t1.name, t2. Marks from t1 left join t2 on t1. Id=t2. Id where age=(select age from t1 order by age desc limit 1,1) —- this will give person having marks with second highest age.
This is not a ideal query. 😁
Master Yoda 2020-06-19 12:42:52
And my mistake, it should work with inner too. Above query
Master Yoda 2020-06-19 12:45:24
Left join you only use if you want display name where max age is null like that value 4 from table is not there and deleted
NeverFaded 2020-06-19 13:39:21
Hey guys, im getting some trouble with foreign keys in mysql, if i have a table called “artista” a table called “inciso” that references “artista”, is there a better way to referenciate “inciso” to “artista”? This is the code https://hastebin.com/rogejocida.sql form the 2 tables (as long as tables have one key is fine but with multiple i dont know how to write it)
MasterZiv 2020-06-19 13:52:23
NeverFaded 2020-06-19 13:39:21
Hey guys, im getting some trouble with foreign keys in mysql, if i have a table called “artista” a table called “inciso” that references “artista”, is there a better way to referenciate “inciso” to “artista”? This is the code https://hastebin.com/rogejocida.sql form the 2 tables (as long as tables have one key is fine but with multiple i dont know how to write it)
It is all ok with what you have sent, but, if you change the PK in the table “artists” from natural key to surrogate key the fk constraint will look nicer.
Please note that both ways are fully valid
NeverFaded 2020-06-19 14:08:09
MasterZiv 2020-06-19 13:52:23
It is all ok with what you have sent, but, if you change the PK in the table “artists” from natural key to surrogate key the fk constraint will look nicer.
Please note that both ways are fully valid
Thanks very much I’ll look up on that
Manik .. 2020-06-20 11:41:04
guys any idea regarding mysql replication tools ?
pls suggest if any
Master Yoda 2020-06-20 13:45:06
Manik .. 2020-06-20 11:41:04
guys any idea regarding mysql replication tools ?
pls suggest if any
Tools for what? Monitoring replication?
Manik .. 2020-06-20 13:49:04
fr DC – DR replication
need an automatic tool thats works in place of master -slave replucation.
automatic tool.
2020-06-20 18:13:59
How to restore MySQL from local machine to rds. Tried restore from s3 but it shows smaller db version
Plz help
MasterZiv 2020-06-21 08:44:45
2020-06-20 18:13:59
How to restore MySQL from local machine to rds. Tried restore from s3 but it shows smaller db version
Plz help
Use mysqldump utility to backup the DB and then mysql utility to restore it at the new site
2020-06-22 08:19:44
Which us better? 2 mysql database in single rds instance or seperate db instance for each db
MasterZiv 2020-06-22 08:20:34
2020-06-22 08:19:44
Which us better? 2 mysql database in single rds instance or seperate db instance for each db
Explain in details pls
huiuneed 2020-06-22 10:39:05
2020-06-22 08:19:44
Which us better? 2 mysql database in single rds instance or seperate db instance for each db
Deploying two instances is better for performance, because mysql and innodb has some exclusive resources for example mutex, rwlock, spin lock. However deploying one instance is convience for managing, for example replication, backup and migration
Deb_575 2020-06-22 10:54:06
Hello guys can anyone guide me on how can accelerate my mysql restore process, what parameters do you tune to restore a database of 220gb size, dump taken through mysqldump utility. I have already set the max_allowed_packet parameter to 500M
acromegale 2020-06-22 11:05:05
Deb_575 2020-06-22 10:54:06
Hello guys can anyone guide me on how can accelerate my mysql restore process, what parameters do you tune to restore a database of 220gb size, dump taken through mysqldump utility. I have already set the max_allowed_packet parameter to 500M
mysql perform restoration from mysqldump sequentially in one thread, he haven’t params for tune, use xtrabackup instead mysqldump
Deb_575 2020-06-22 11:06:53
Xtrabackup will work for refresh as well as in from prod db to test db (different servers)
acromegale 2020-06-22 11:18:37
i didn’t catch what do you mean
acromegale 2020-06-22 11:29:20
do you mean compatibility backup files between servers?
Deb_575 2020-06-22 11:31:39
Yes
Deb_575 2020-06-22 11:32:36
From one server to another server. Prod being aix and Dev redhat
acromegale 2020-06-22 13:36:16
i’m not sure, maybe in cases if these servers have a different common libs e.g. zlib and etc
NeverFaded 2020-06-22 20:01:25
hey guys i’m struggling with a query and it finally worked but i’m trying to look if there is something clearer or just a better query
I Oversimplified just to get to the point
I have a product table with and ID (auto incremented so every product is diffent) and same products have the same name
Id is primary key and name isn’t
There is a table Bought
I’d like to select (by query) the product most bought (so i need to count the name)
Here’s the code https://hastebin.com/qihazixasi.sql
Thanks in advance!
MasterZiv 2020-06-22 20:46:54
NeverFaded 2020-06-22 20:01:25
hey guys i’m struggling with a query and it finally worked but i’m trying to look if there is something clearer or just a better query
I Oversimplified just to get to the point
I have a product table with and ID (auto incremented so every product is diffent) and same products have the same name
Id is primary key and name isn’t
There is a table Bought
I’d like to select (by query) the product most bought (so i need to count the name)
Here’s the code https://hastebin.com/qihazixasi.sql
Thanks in advance!
Im afraid this query is not correct. Not doing the goal
NeverFaded 2020-06-22 20:54:56
Maybe trying to oversimplifying the query and translating it made it look it doesn’t so i copypasted the not simplified query (i’ve tryed to translate it) and the not simplidied query not translated which i’m sure it works (at least for the few example i tried) Here’s the code https://hastebin.com/kazusisudi.sql
MasterZiv 2020-06-22 22:56:12
NeverFaded 2020-06-22 20:54:56
Maybe trying to oversimplifying the query and translating it made it look it doesn’t so i copypasted the not simplified query (i’ve tryed to translate it) and the not simplidied query not translated which i’m sure it works (at least for the few example i tried) Here’s the code https://hastebin.com/kazusisudi.sql
Enough, not me…
omiikharkar 2020-06-23 14:55:30
Hello everyone I want to learn MYSQL so can anyone guide me..how to start.???
Sergey 2020-06-24 10:12:07
omiikharkar 2020-06-23 14:55:30
Hello everyone I want to learn MYSQL so can anyone guide me..how to start.???
Giraffe academy on youtube
Sergey 2020-06-24 10:13:16
https://m.youtube.com/watch?v=HXV3zeQKqGY
SQL Tutorial – Full Database Course for Beginners –
YouTubeIn this course, we’ll be looking at database management basics and SQL using the MySQL RDBMS.
Want more from Mike? He’s starting a coding RPG/Bootcamp – https://simulator.dev/
The course is designed for beginners to SQL and database management systems, and will introduce common database management topics.
Throughout the course we’ll be looking at various topics including schema design, basic C.R.U.D operations, aggregation, nested queries, joins, keys and much more.
You can get PopSQL to follow along here: http://popsql.com/freecodecamp
🔗Company Database Code: https://www.giraffeacademy.com/databases/sql/creating-company-database/
⭐️ Contents ⭐
⌨️ (0:00) Introduction
⌨️ (2:36) What is a Database?
⌨️ (23:10) Tables & Keys
⌨️ (43:31) SQL Basics
⌨️ (52:26) MySQL Windows Installation
⌨️ (1:01:59) MySQL Mac Installation
⌨️ (1:15:49) Creating Tables
⌨️ (1:31:05) Inserting Data
⌨️ (1:38:17) Constraints
⌨️ (1:48:11) Update & Delete
⌨️ (1:56:11) Basic Queries
⌨️ (2:08:37) Company Database Intro
⌨️ (2:14:05) Creating Company Database
⌨️ (2:30:27 ) More Basic Queries
⌨️ (2:26:24) Functions
⌨️ (2:45:13) Wildcards
⌨️ (2:53:53) Union
⌨️ (3:01:36) Joins
⌨️ (3:11:49) Nested Queries
⌨️ (3:21:52) On Delete
⌨️ (3:30:05) Triggers
⌨️ (3:42:12) ER Diagrams Intro
⌨️ (3:55:53) Designing an ER Diagram
⌨️ (4:08:34) Converting ER Diagrams to Schemas
Course developed by Mike Dane. Check out his YouTube channel for more great programming courses: https://www.youtube.com/channel/UCvmINlrza7JHB1zkIOuXEbw
🐦Follow Mike on Twitter: http://twitter.com/mike_dane
🔗The Giraffe Academy website: http://www.giraffeacademy.com/
—
Learn to code for free and get a developer job: https://www.freecodecamp.org
Read hundreds of articles on programming: https://medium.freecodecamp.org
ranasharif 2020-06-24 13:01:59
Hi, anybody can help me to understand
Asset Managment with Accounting Transection
Please….
ranasharif 2020-06-24 13:05:03
ranasharif 2020-06-24 13:01:59
Hi, anybody can help me to understand
Asset Managment with Accounting Transection
Please….

I mean how to control structured using the code when a software design for accounting.
ranasharif 2020-06-24 13:07:36
ranasharif 2020-06-24 13:01:59
Hi, anybody can help me to understand
Asset Managment with Accounting Transection
Please….
I know this group not a accounting based but it’s related with database designing with Chart of Accounts for Accounting Transection.
2020-06-25 11:33:27
Hi Everyone
As we are using Google Cloud MySQL, now would like to add an user who can not do deletion, truncate and script altering only do crud operations only please help
Master Yoda 2020-06-25 17:23:18
2020-06-25 11:33:27
Hi Everyone
As we are using Google Cloud MySQL, now would like to add an user who can not do deletion, truncate and script altering only do crud operations only please help
Create separate users
MasterZiv 2020-06-25 23:33:57
Cpt. Jack Sparrow , @Michealcrichton , if you want to do offtopic, go communicate privately
sivarishi 2020-06-27 17:19:30
How to Insert Image and File as a BLOB data into MySQL Table?
acromegale 2020-06-27 17:20:56
you are sure you are really want store images/ files in database?
Animesh Negi 2020-06-27 17:21:37
Is it possible to store these type of data ?
acromegale 2020-06-27 17:22:00
yep, but dont do that
Animesh Negi 2020-06-27 17:22:12
acromegale 2020-06-27 17:22:00
yep, but dont do that
Why?
acromegale 2020-06-27 17:23:43
because this is antipattern
← prev | next →